﻿using ProxyWrapper.CommonProxyService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ServiceDone : AppServices
{
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        try
        {
            if (Request.Form["action"] != null && Request.Form["action"].ToString() == "editAdvanced")
            {
                AddServiceProperties();
            }
        }
        catch (Exception)
        {
        }
    }
    private void AddServiceProperties()
    {
        string deleteSavedScans = Request.Form["deleteSavedScans"].ToString();
        string email = Request.Form["emailToSendUploadsTo"] != null? Request.Form["emailToSendUploadsTo"].ToString():"";
        string allowedBarCd =Request.Form["symbologies[]"]!=null? Request.Form["symbologies[]"].ToString():"";
        string viewOtherScans = Request.Form["viewOtherScans"].ToString();
        string editSavedAnswers = Request.Form["editSavedAnswers"].ToString();
        ServiceProperties prop = new ServiceProperties() {
        AllowedBarCodes  = allowedBarCd,
        DeleteSavedScans = deleteSavedScans=="on"?true:false,
        ViewOtherScans= viewOtherScans=="on"?true:false,
        EditSavedAnswers = editSavedAnswers == "on" ? true : false,
        EmailMeOnUploadEmailId = email
        
        };
        ProxyWrapper.ServicesServiceWrapper wrap = new ProxyWrapper.ServicesServiceWrapper();
        wrap.AddServiceProperties(ServiceId, UserDetails.ClientId, prop);
    }
}